/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.edu.entity;

import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.entity.TreeEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 专业职称Entity
 * @author 赵俊飞
 * @version 2019-03-01
 */
@Table(name="edu_professional_title", alias="a", columns={
		@Column(name="professional_id", attrName="professionalId", label="编码", isPK=true),
		@Column(includeEntity=TreeEntity.class),
		@Column(name="professional_name", attrName="professionalName", label="区域名称", queryType=QueryType.LIKE,isTreeName=true),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.tree_sorts, a.professional_id"
)
public class EduProfessionalTitle extends TreeEntity<EduProfessionalTitle> {
	
	private static final long serialVersionUID = 1L;
	private String professionalId;		// 编码
	private String professionalName;		// 区域名称
	
	public EduProfessionalTitle() {
		this(null);
	}

	public EduProfessionalTitle(String id){
		super(id);
	}
	
	@Override
	public EduProfessionalTitle getParent() {
		return parent;
	}

	@Override
	public void setParent(EduProfessionalTitle parent) {
		this.parent = parent;
	}
	
	public String getProfessionalId() {
		return professionalId;
	}

	public void setProfessionalId(String professionalId) {
		this.professionalId = professionalId;
	}
	
	@NotBlank(message="区域名称不能为空")
	@Length(min=0, max=100, message="区域名称长度不能超过 100 个字符")
	public String getProfessionalName() {
		return professionalName;
	}

	public void setProfessionalName(String professionalName) {
		this.professionalName = professionalName;
	}

	@Override
	public String toString() {
		if(professionalName!=null) {
			return professionalName;
		}
		return "";
	}
	
}